import java.awt.Graphics;
import java.util.Vector;

import javax.swing.JPanel;

/**
 * gestioneaza un vector cu triunghiuri
 *
 */
class Tpanel extends JPanel
{
   Vector triangles;
   public Tpanel()
   {
      triangles = new Vector();
   }
   
   /**
    * adauga un triunghi in vector
    * @param t
    */
   public void addTriangle(Triangle t)
   {
      triangles.addElement(t);
   }
   public void paint(Graphics g)
   {
      for (int i = 0; i < triangles.size(); i++)
      {
         Triangle tngl = (Triangle)triangles.elementAt(i);
         tngl.draw(g);
      }
   }
}